<%-- 
    Document   : index
    Created on : 07.04.2014, 14:33:32
    Author     : kgp
--%>

<%@page import="model.MoodleCategory"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page errorPage="errorPage.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<jsp:useBean id="categoriesBean" class="view.MoodleCategoriesBean" scope="session"/>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Список категорій серверу Moodle</title>
        <link href="${pageContext.request.contextPath}/moodleclient.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
        <h1>Список категорій серверу Moodle: ${categoriesBean.categories.size()}</h1>
        <table>
            <tr>
                <th>ID</th>
                <th>NAME</th>
                <th>DESCRIPTION</th>
                <th>COURSE COUNT</th>
                <th>PARENT ID</th>
                <th>SORT ORDER</th>
                <th>DEPTH</th>
                <th>PATH</th>
                <th>THEME</th>
                <th>VISIBLE</th>
            </tr>
            <c:forEach var="category" items="${categoriesBean.categories}"> 
                <tr>
                    <td><c:out value="${category.getId()}"></c:out></td>
                    <td><c:out value="${category.getName()}"></c:out></td>
                    <td><c:out value="${category.getDescription()}"></c:out></td>
                    <td><c:out value="${category.getCoursecount()}"></c:out></td>
                    <td><c:out value="${category.getParent()}"></c:out></td>
                    <td><c:out value="${category.getSortorder()}"></c:out></td>
                    <td><c:out value="${category.getDepth()}"></c:out></td>
                    <td><c:out value="${category.getPath()}"></c:out></td>
                    <td><c:out value="${category.getTheme()}"></c:out></td>
                    <td><c:out value="${category.getVisible()}"></c:out></td>
                    </tr>
            </c:forEach> 
        </table>
        <p><a href="index.jsp">На стартовую страницу</a></p>
    </body>
</html>
